package com.lxh.lxhcrm.model.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

/**
 * 详细报价表
 */
@Entity
@Table(name = "detail_offer", schema = "lxh_crm", catalog = "")
public class DetailOffer {
    private int detailOfferId;
    private Integer productNum;
    private Double totalPrice; //此类商品总价
    private Double offer;  //所报金额
    //    private Integer productId;
    private ProDetail productDetail; // 商品表  一对一
    private Opportunity opportunity;// 机会表  多对一



    @ManyToOne
    @JoinColumn(name = "oppo_id" , referencedColumnName = "oppo_id")
    public Opportunity getOpportunity() {
        return opportunity;
    }

    public void setOpportunity(Opportunity opportunity) {
        this.opportunity = opportunity;
    }

    @OneToOne
    @JoinColumn(name = "pro_detail_id")
    public ProDetail getProductDetail() {
        return productDetail;
    }

    public void setProductDetail(ProDetail productDetail) {
        this.productDetail = productDetail;
    }

    @Id
    @Column(name = "detail_offer_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getDetailOfferId() {
        return detailOfferId;
    }

    public void setDetailOfferId(int detailOfferId) {
        this.detailOfferId = detailOfferId;
    }

    @Basic
    @Column(name = "product_num", nullable = true)
    public Integer getProductNum() {
        return productNum;
    }

    public void setProductNum(Integer productNum) {
        this.productNum = productNum;
    }

    @Basic
    @Column(name = "offer", nullable = true, precision = 0)
    public Double getOffer() {
        return offer;
    }

    public void setOffer(Double offer) {
        this.offer = offer;
    }

    @Basic
    @Column(name = "total_price", nullable = true, precision = 0)
    public Double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

}
